#ifndef JSONPARSER_EXPORTS
#define JSONPARSER_EXPORTS 
#endif
#include "CBlockProviderFactory.h"
#include "CBlocksProviderImpl.h"

 
 CBlockProviderFactory*  CBlockProviderFactory::m_cInstance = 0;

CBlockProviderFactory::CBlockProviderFactory(void)
{ 

}

CBlockProviderFactory::~CBlockProviderFactory(void)
{
	if (m_cProviderImpl)
	{
		delete m_cProviderImpl  ;
		m_cProviderImpl = NULL;
	}
}


CBlockProviderFactory* CBlockProviderFactory::GetInstance()
{
	if (0 == m_cInstance)
	{
		m_cInstance=new CBlockProviderFactory();
		m_cInstance->m_cProviderImpl = NULL;
	}
	return m_cInstance;
}
bool  CBlockProviderFactory::ClearInstance()
{
	if (m_cInstance)
	{
		delete m_cInstance;
		m_cInstance = 0;
	}
	return true;
}
 
IBlocksProvider * CBlockProviderFactory::CreateProvider(std::string iniPath)
{ 
	if (!m_cProviderImpl)
	{
		m_cProviderImpl = new CBlocksProviderImpl(iniPath);
	}
	return m_cProviderImpl;
}